<template>
  <div class="balance_source_container">
    <div class="balance_source_box">
      <div class="table_box">
        <el-table :data="soureTableData" style="width: 100%">
          <el-table-column prop="name" label="来源名称"> </el-table-column>
          <el-table-column prop="created_at" label="创建时间">
          </el-table-column>
          <el-table-column prop="updated_at" label="更新时间">
          </el-table-column>
        </el-table>
      </div>
      <div class="page_box">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageNow"
          :page-sizes="[10, 20, 30, 40]"
          :page-size="pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import { getAppUserBalanceTypeList } from "@/api/balanceRecord.js";
export default {
  data() {
    return {
      pageNow: 1,
      pageSize: 10,
      total: null,
      soureTableData: [],
    };
  },
  mounted() {
    this.getAppUserBalanceTypeList();
  },
  methods: {
    getAppUserBalanceTypeList() {
      getAppUserBalanceTypeList({
        page_now: this.pageNow,
        page_size: this.pageSize,
      }).then((res) => {
        if (res.code == 1) {
          this.soureTableData = res.data;
          this.total = res.page_info.total_count;
        } else {
          this.$message.error(res.msg);
          return;
        }
      });
    },

    handleSizeChange(val) {},
    handleCurrentChange(val) {},
  },
};
</script>
<style lang="scss" scoped>
.balance_source_container {
  padding: 20px 30px;

  .balance_source_box {
    .page_box {
      display: flex;
      justify-content: center;
      padding: 20px 0;
    }
  }
}
</style>
